1. Field of the Invention
The present invention relates to a method and apparatus for filtering video data, and more particularly, to a method and apparatus for deblocking-filtering video data containing a block encoded with illumination compensation.
2. Description of the Related Art
In video compression standards such as moving picture expert group (MPEG)-1, MPEG-2, MPEG-4, H.264/MPEG-4 AVC (Advanced Video Coding) standards, a picture is divided into the units of image processing, i.e., macroblocks, for video encoding. Each of the macroblocks is then encoded using interprediction or intraprediction.
These video compression methods perform decoding after performing compression encoding in units of macroblocks, resulting in blocking artifacts in the reconstructed video data. Discrete cosine transformation (DCT) and quantization are performed independently on each sub-block, e.g., each 4×4 block, included in each macroblock. In other words, each sub-block is independently Discrete Cosine Transformed and quantized regardless of correlation with its neighboring blocks, causing a loss in the original video data, and creating blocking artifacts in reconstructed video data.
A deblocking filter smoothes a block boundary error generated in block-based coding, thereby improving the quality of reconstructed video data, as will be described in detail with reference to FIGS. 1A, 1B, and 2.
FIG. 1A is a block diagram of a video encoder according to a related art and FIG. 1B is a block diagram of a video decoder according to the related art. The video encoder illustrated in FIG. 1A performs video encoding through interprediction according to the H.264 standard and the video decoder illustrated in FIG. 1B decodes the interpredicted video data.
Referring to FIG. 1A, a motion estimation unit 110 generates a motion vector of the current block to be encoded by referring to at least one reference picture stored in a frame memory unit 122. A motion compensation unit 112 generates a prediction block of the current block based on the motion vector generated by the motion estimation unit 110.
The generated prediction block is subtracted from the original current block, thereby generating a residue. A DCT and quantization unit 114 performs DCT and quantization on the generated residue. An entropy-coding unit 116 performs entropy-coding on the quantized residue. The coded residue, together with the motion vector, is inserted into a bitstream for transmission to a decoding side.
The residue quantized by the DCT and quantization unit 114 is inversely quantized and inversely DCTed by an inverse quantization and inverse DCT unit 118 in order to be used in prediction of the next picture to be coded.
The reconstructed residue is added to the prediction block and the addition result is stored in the frame memory unit 122. The addition result is deblocking-filtered by a deblocking filtering unit 120 before being stored in the frame memory unit 122 because the blocking artifacts may occur if the addition result is stored in the frame memory unit 122 without being processed. The deblocking filtering according to the related art will be described later in detail with reference to FIG. 2.
FIG. 1B is a block diagram of a video decoder for decoding a block that is interprediction-encoded by the video encoder illustrated in FIG. 1A.
Referring to FIG. 1B, a motion compensation unit 128 searches a reference picture stored in a frame memory unit 132 based on data about a motion vector included in a bitstream, thereby generating a prediction block of the current block.
An entropy-decoding unit 124 receives an encoded residue and performs entropy-decoding on the received residue. The entropy-decoded residue is inversely quantized and inversely DCTed by an inverse quantization and inverse DCT unit 126. The residue reconstructed by inverse quantization and inverse DCT is added to the prediction block generated by the motion compensation unit 128, thereby being reconstructed to the original block before encoding. Like in encoding, if the reconstructed block is stored in the frame memory unit 132 without being processed, the blocking artifacts may occur. For this reason, the reconstructed block is stored in the frame memory unit 132 after being deblocking-filtered by a deblocking filtering unit 130.
FIG. 2 is a flowchart of a deblocking filtering method according to the related art. In FIG. 2, the deblocking filtering unit 120 or 130 performs deblocking filtering according to the H.264 standard.
Referring to FIG. 2, the deblocking filtering unit 120 or 130 determines whether at least one of two adjacent blocks, p and q to be deblocking-filtered, has been intracoded in operation 201.
If so, the deblocking filtering unit 120 or 130 determines whether the blocks, p and q to be deblocking-filtered, are located in a macroblock boundary in operation 202. If so, the deblocking filtering unit 120 or 130 performs deblocking filtering after setting its filtering strength Bs to 4 in operation 206. If the blocks, p and q to be deblocking-filtered, are not located in the macroblock boundary, the deblocking filtering unit 120 or 130 performs deblocking filtering after setting its filtering strength Bs to 3 in operation 207.
If neither the block p nor the block q has been intracoded, the deblocking filtering unit 120 or 130 determines whether at least one of the block p and the block q has an orthogonal transformation coefficient, i.e., a DCT coefficient in operation 203. If so, the deblocking filtering unit 120 or 130 performs deblocking filtering after setting its filtering strength Bs to 2 in operation 208. If neither the block p nor the block q has an orthogonal transformation coefficient, the deblocking filtering unit 120 or 130 goes to operation 204.
If neither the block p nor the block q has an orthogonal transformation coefficient in operation 203, the deblocking filtering unit 120 or 130 determines whether reference frames for the blocks p and q are different from each other or the number of reference frames for the block p is different from that for the block q in operation 204. If so, the deblocking filtering unit 120 or 130 performs deblocking filtering after setting its filtering strength Bs to 1 in operation 209.
If reference frames for the block p and the block q are the same as each other and the number of reference frames for the block p is the same as that for the block q in operation 204, the deblocking filtering unit 120 or 130 determines whether a motion vector of the block p is different from that of the block q in operation 205. If so, the deblocking filtering unit 120 or 130 performs deblocking filtering after setting it filtering strength to a Bs of 1 in operation 209. If the motion vector of the block p is not different from that of the block q in operation 205, the deblocking filtering unit 120 or 130 sets it filtering strength to a Bs of 0 and thus does not perform deblocking filtering in operation 210.
As set forth regarding operations 201 through 210, the deblocking filtering method according to the prior art does not consider the case where the two adjacent blocks p and q have been encoded using illumination compensation. A discrete cosine (DC) value of the current block differs according to whether the current block has been encoded using illumination compensation or without using illumination compensation, and causes blocking artifacts, but the conventional deblocking filtering methods do not consider whether encoding has been performed using illumination compensation
Therefore, there is a need for a method and apparatus for deblocking filtering video data by considering the case where the video data has been encoded using illumination compensation.